package com.laterem.rtc.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @creator: alan wu
 * @dateTime: 2023/5/28 20:41
 * @desc:
 */
@Data
@TableName("activity_item")
public class ActivityItemDO {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private Integer activityId;
    private Integer parentItemId;

    private Integer result;
    @TableField(exist = false)
    private Integer userResult;

    @TableField(exist = false)
    private Map<String, Object> data = new HashMap<>();

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    /**
     * 新加字段2023.06.10
     */
    // 报名总人数
    @TableField(exist = false)
    private Integer totalUser;
    // 剩余人数
    @TableField(exist = false)
    private Integer leftUser;
    // 第几轮次
    @TableField(exist = false)
    private Integer round;
    // 选择1的人数
    @TableField(exist = false)
    private Integer chooseOne;
    //  选择2的人数
    @TableField(exist = false)
    private Integer chooseTwo;
    // 本轮获胜人数
    @TableField(exist = false)
    private Integer countWinner;

    // 开奖结果：1：未开奖 2：恭喜进入下一轮 3：上一轮未中奖
    @TableField(exist = false)
    private Integer drawResult;
}